home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
utils
/
colacalc.lzh
/
COLACALC.TXT
< prev
Wrap
Text File
|
1995-08-18
|
14KB
|
337 lines
ColaCalc (Version 1.3)
by Dan Wilga
Copyright © 1995, Gribnif Software. All Rights Reserved.
This program may be distributed without charge, provided that this text
file is present and that it and the program files are unmodified.
ChocolateWare
-------------
This program was originally ColaWare (duh!), but it's now ChocolateWare.
If you find it useful, you are encouraged to show your appreciation by
sending a quantity of chocolate candy to the address below. What kind and
how much are up to you. Please just limit yourself to chocolate, either
with or without nuts (no fruits or liquers, please).
Dan Wilga
Gribnif Software
PO Box 779
Northampton, MA 01061
GEnie: GRIBNIF
Internet: gribnif@genie.geis.com
Overview
--------
What? ANOTHER calculator? Yup, another calculator. But this one's
different, I promise!
There are a number of really good calculator programs out there for the
ST. Most of them just don't fit my needs for several reasons. The simple
ones don't have what I need, and the ones that do have all of the
programming functions I want are too huge, difficult to use, and take too
much memory. And even though most of them are desk accessories, you
still can't access a desk accessory within a non-GEM program. So I've
always had to keep my old Casio calculator sitting on top of the
computer.
Enter ColaCalc. This tiny little program (about 8k) is a full-featured
programmer's calculator. No pretty dialog box, no floating point, no
linear regression, but a calculator that's always there when you need it.
And, best of all, you can change the keys to whatever you want, you
aren't stuck with what I think are good keyboard equivalents!
ColaCalc can be activated at a single keypress. The display occupies the
very bottom of your screen, and as such hides very little data. The
calculator functions include the standard operators, bit manipulation,
word size and base (binary, octal, decimal, or hex.) There is also a
special mode that lets you see the scan code generated by any key on the
keyboard.
ColaCalc can even insert the value in the display into your text editor
or word processor, automagically!
It is also designed to work in any standard video mode, as well as with
the TT, Falcon, MegaSTe, and Crazy Dots video board.
Installation:
------------
Run COLACALC.PRG from the desktop, or place it in your AUTO folder. If you
use a COLACALC.DAT file, then it should be in the same folder as the program.
If you are holding down the Alternate key while ColaCalc is loading, then it
will not install itself. This is a good way to keep it from installing when
it is in your AUTO folder, without having to re-boot.
IMPORTANT: If you use the Templemon debugger, ColaCalc may not be able to
be activated. Templemon uses the same vector for monitoring the keyboard
that ColaCalc does, and it may prevent ColaCalc from seeing keypresses.
In order for ColaCalc to work, it must be placed physically after
TEMPLMON.PRG in the AUTO folder.
Activating It:
-------------
Unless you have changed the activation keypress (see Configuration), you
can always call ColaCalc from within any program simply by pressing
Control-Undo. The only time ColaCalc may not appear is when a disk access
is occuring. To quit ColaCalc, press either Esc or Undo.
If you call ColaCalc within a text editor or word processor, you can have
it pass the value in the display to the program, to become part of the
text. Simply hold down the Alternate key while pressing Esc or Undo to
quit. As soon as you release the Alternate key, the text editor will
receive the display value, as though it had been typed on the keyboard.
It is important that you not press any of the Shift keys while this is
going on, or the editor may become confused.
The Display:
-----------
Here is a diagram of what the parts of the display mean:
ulb 10100010101010001010100010101001 XOR 1.......9.
||| \ / | \ \
/ | \ --------- number ----------- | function key memories
signed/unsigned | base operator
word size
All keyboard controls listed below are the defaults.
Signed (S key); Unsigned (U key):
These control whether or not a negative number is to be displayed with
a minus sign in front of it (signed) or if the sign bit should be
displayed as part of the number (unsigned). These can also affect
translating between word sizes (see below).
Word Size: Byte (Alt-B); Word (Alt-W); Long (Alt-L):
By setting the word size you affect how much of the number is
displayed. If, for example, the display is set for Byte, the largest
value that can be displayed is FF (hex).
When changing from a small word size to a larger one, the value is
sign-extended if the display is set to show the sign, otherwise it is
not. This means that if, for example, you are converting FF from a
byte to a word without the sign, then this will become 00FF. If, on the
other hand, the sign is being used, FF (which shows up as -1) will
still be -1 after the extension.
Base: Binary (Control-B); Octal (Control-O); Decimal (Control-D);
Hexadecimal (Control-H):
These control the base to display values in. In Binary mode, large
numbers will have small circles after every eight bits to indicate the
byte boundaries.
Number:
The keys 0-9 and A-F (or a-f) can be used to enter numbers. The keypad
keys will also work under the default configuration.
Function:
This portion of the display shows what function was last entered. It may
also contain "-E-" if an error occurred; if this happens, press
Clr/Home.
Function Key Memories:
The F1-F10 keys can be assigned values by pressing Shift along with the
appropriate F-key. A number can be recalled later by pressing just the
function key, without Shift. If a particular function key has a
non-zero value assigned to it, this will show up in the function key
segment of the display.
The display will not include the function key segment or the function
name if you are using low resolution.
Miscellaneous Keys:
------------------
=, Return, Enter Calculate result
Undo, Esc Quit ColaCalc
Alt-Undo, Alt-Esc Quit and type value
Clr/Home Clear display/Clear error
Shift-Fkey Set memory
Fkey Recall memory
Backspace Undo last digit typed
Help Enter/Exit Keypress mode
The first time you press Clr/Home clears the display or any error
condition, which shows up as "-E-". If you press it a second time, any
operator still waiting to be processed is cleared.
When in Keypress mode, the display shows the value for any shift keys
pressed, the scan code of the last key pressed, its ASCII value in hex,
and the actual character that key produces (if non-zero.) This is handy
for writing your own configuration file (see below). To exit Keypress
mode, press the Help key again.
Operators:
---------
Unary operators (NEG, NOT and the PEEKs) are processed immediately.
Binary operators (like + and *) are processed in the order they are
received, with the exception of * and /, which take highest precedence.
This means that:
1 + 2 * 3 is processed as 1+(2*3)
1 * 2 + 3 is processed as (1*2)+3
1 + 2 * 3 / 2 is processed as 1+((2*3)/2)
1 & 2 * 3 is processed as 1&(2*3)
If the second operand is not entered for a binary operator, then the
first operand is reused. This means that:
2 * = is processed as 2*2
4 / = is processed as 4/4
A binary operator can be replaced with another by simply entering the new